/*
 * File:   RandomKnockingStrategy.h
 * Author: root
 *
 * Created on November 18, 2008, 3:05 PM
 */

#include "KnockingStrategy.h"

#ifndef _RANDOMKNOCKINGSTRATEGY_H
#define	_RANDOMKNOCKINGSTRATEGY_H

class RandomKnockingStrategy : public KnockingStrategy {

    int decisionCertainty;
    int knockingProbability;

protected:
    virtual void setExecutionParameter(int index, int rangeFraction) {
        // The execution parameter is the probability of knocking
        knockingProbability = rangeFraction;
    }

public:
    
    RandomKnockingStrategy() 
    : KnockingStrategy(string("RandomKnockingStrategy"), 1), decisionCertainty(0), knockingProbability(0) {}
    
    RandomKnockingStrategy(int myWeight)
    : KnockingStrategy(myWeight), decisionCertainty(0), knockingProbability(0)
    {
    }
                
    virtual int getDecisionCertainty() {
//        return (100 * currentHandValue) / 28;  // Where the value ranks in the range of hand values
        return decisionCertainty;
    }

    virtual Strategy* getActiveInstance(int inst_weight) {
        return dynamic_cast<Strategy*>(new RandomKnockingStrategy(inst_weight));
    }
    
    virtual void opponentMove(int opponent, const Move& move) {}
    virtual bool decideKnock(CCardStack*, const GameState*);

};

#endif	/* _RANDOMKNOCKINGSTRATEGY_H */

